/*
   CashDrawerService.h
   
   Copyright (C) 2006 LinuxOne, Inc. <Republic of korea>

   This library is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as
   published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   Lessor General Public License for more details.

   You should have received a copy of the GNU Lessor General Public
   License along with this library; if not, write to the Free Software
   Foundation, inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

   Hyunjin Kim <mgc521@linuxone.co.kr>

   LinuxOne, Inc., hereby disclaims all copylight
   written by Hyunjin Kim, 20 December 2006
*/

#ifndef _BOOYO_POS_CASHDRAWER_SERVICE_H_
#define _BOOYO_POS_CASHDRAWER_SERVICE_H_

#include "BaseService.h"
#include <BooyoPOSException.h>
#include <const/CashDrawerConst.h>

namespace booyopos
{

namespace services
{

class CCashDrawerService : public CBaseService, public CCashDrawerConst
{
public:
	CCashDrawerService();
	~CCashDrawerService();

	/* Capabilities */
	bool GetCapStatus() throw (CByException);
	int GetCapPowerReporting() throw (CByException);
	bool GetCapStatusMultiDrawerDetect() throw (CByException);
	bool GetCapStatisticsReporting() throw (CByException);
	bool GetCapUpdateStatistics() throw (CByException);
	bool GetCapCompareFirmwareVersion() throw (CByException);
	bool GetCapUpdateFirmware() throw (CByException);

	/* Properties */
	bool GetDrawerOpened() throw (CByException);
	int GetPowerNotify() throw (CByException);
	void SetPowerNotify(int powerNotify) throw (CByException);
	int GetPowerState() throw (CByException);

	/* Methods */
	void OpenDrawer() throw (CByException);
	void WaitForDrawerClose(int beepTimeout, int beepFrequency, int beepDuration, int beepDelay) throw (CByException);

	/* Statistics */
	void ResetStatistics(std::string statisticsBuffer) throw (CByException);
	void RetrieveStatistics(std::string statisticsBuffer[]) throw (CByException);
	void UpdateStatistics(std::string statisticsBuffer) throw (CByException);
	void CompareFirmwareVersion(std::string firmwareFileName, int* result) throw (CByException);
	void UpdateFirmware(std::string firmwareFileName) throw (CByException);

	/* Event Handler */
	//sigc::signal<void, int, int, void*>DirectIOEvent_signal() { return DirectIOEvent; }
	//sigc::signal<void, int>StatusUpdateEvent_signal() { return StatusUpdateEvent; }
};

} // namespace services

} // namespace booyopos

#endif // _BOOYO_POS_CASHDRAWER_SERVICE_H_
